import { Observable } from 'rxjs'

/**
 * 错误过滤操作符
 */
export const commonErrorFilterOperator = <T = number>(source: Observable<T>) => {
  return new Observable<T>(observer => {
    return source.subscribe({
      next: v => {
        observer.next(v)
      },
      error: err => {
        console.log('通用错误被过滤!!!!', err)
        observer.complete()
      }
    })
  })
}
